import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:get/get.dart';

import 'locales/locale_en.dart';
import 'locales/locale_zh.dart';


/// 翻译类
class Translation extends Translations {

  //定义需要翻译的语言的key
  //如果需要其他语言翻译，在这里加
  @override
  Map<String, Map<String, String>> get keys => {
    'en': localeEn,
    'zh': localeZh,
  };

  // 如果出错，默认选择的语言
  static const fallbackLocale = Locale('en', 'US');

  // 当前支持的语言,这里也需要增加
  static const supportedLocales = [
    Locale('en', 'US'),
    Locale('zh', 'CN'),
  ];

  // 代理
  static const localizationsDelegates = [
    GlobalMaterialLocalizations.delegate,
    GlobalWidgetsLocalizations.delegate,
    GlobalCupertinoLocalizations.delegate,
  ];

}
